package chapter09

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/9 22:12
  * @history:
  *          1.2019/1/9 created by chuhaitao
  */
object TraitDemo03 {

  def main(args: Array[String]): Unit = {
    var sh=new Sheep
    sh.sayHi()
    sh.sayHello()
  }

}

trait Trait3{

/*抽象方法*/
  def sayHi():Unit
/*实现的方法*/
  def sayHello():Unit={
    println("0909")
  }


}

class Sheep extends Trait3{
  override def sayHi(): Unit = {
    println("090219")
  }
}